
import 'package:jtlf/proto/user/user.pb.dart';
import 'package:shared_preferences/shared_preferences.dart';

logout(SharedPreferences pref) {
  pref.remove('auth_token');
  pref.remove('user_id');
  pref.remove('tenant_id');
  pref.remove('expired');
}

login(SharedPreferences prefs, User user) {
  prefs.setString('auth_token', user.tokenId);
  prefs.setString('user_id', user.id);
  prefs.setString('tenant_id', user.tenantId);
  prefs.setDouble('expired', user.replyTime.toDouble());
}